<?php
require_once("core".DIRECTORY_SEPARATOR."functions.php");

session_start();

	if($_SERVER['REQUEST_METHOD'] != "POST")
	{
		//error
	}
	else
	{
		$eventName = $_POST["eName"];
		$description = $_POST["eDescription"];
		$startTime = $_POST["eStime"];
		$endTime = $_POST["eEtime"];
		$startDate = $_POST["eSdate"];
		$endDate = $_POST["eEdate"];
		$carpoolTime = $_POST["eCtime"];
		$locationDetails = $_POST["eLoc"];
		$meetingLocation = $_POST["eMloc"];
		$manager = $_POST['eMid'];

		//$eventName,$startTime,$endTime,$startDate,$endDate,$meetingLocation,$locationDetails=null,$carpoolTime=null,$manager=null
		$event = new CreateEvent($eventName,$description,$startTime,$endTime,$startDate,$endDate,$meetingLocation,$locationDetails,$carpoolTime);
		if($event->register())
		{
			echo "Event Created";
		}
		else
		{
			echo "Event Creation failed!";
		}
	}

?>